package com.yt.server.common.service;

import java.util.List;
import com.yt.server.api.IScope;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import com.yt.server.common.taglib.PageController;
import com.yt.server.mode.patterns.proxy.Proxy;

public abstract class BaseServiceImpl<K, T> extends Proxy implements
		BaseService<T>, ApplicationContextAware {

	protected Log logger = LogFactory.getLog(getClass());

	protected K dao;

	protected IScope root;

	protected ApplicationContext context;

	public abstract void init();

	public abstract void setDao(K dao);
	
	public abstract void setRoot(IScope root);

	@Override
	public void create(T entity) throws Exception {
	}

	@Override
	public void edit(T entity) throws Exception {
	}

	@Override
	public void delete(List<Long> entity) throws Exception {
	}

	@Override
	public T view(T entity) throws Exception {
		return null;
	}

	@Override
	public List<?> list(Object entity) throws Exception {
		return null;
	}

	@Override
	public PageController<?> pageList(String entity, int page) throws Exception {
		return null;
	}

	@Override
	public void setApplicationContext(ApplicationContext arg0)
			throws BeansException {
		this.context = arg0;
	}
}